package main

import (
	"fmt"
)

type volate interface{
	charge()
	discharge()
}
type Mobile interface{
	volate
	Turnon()
	TurnOff()
}

type huawai struct{
	Name string 
	Brand string 
	price float64
}

type meizhu struct{
	huawai 
	Address string 
}
type ry struct{
	huawai
	int
	na string
}

func (m meizhu)Show(){
	fmt.Println(m.Address,m.Name,m.Brand,"show")
}
func (m huawai)TurnOff(){
	fmt.Println(m.Name,m.Brand,m.price,"huawai TurnOff")
}

func (m huawai)charge(){
	fmt.Println(m.Name,m.Brand,m.price,"huawai charge")
}

func (m huawai)discharge(){
	fmt.Println(m.Name,m.Brand,m.price,"huawai discharge")
}
func (m huawai)Turnon(){

	fmt.Println("huawai trunOn")
}

func worker(m Mobile){
	m.TurnOff()
	m.Turnon()
	m.charge()
	
}
func main(){


	sj:=huawai{"华为","虎",112.12}

	worker(sj)

	mz:=meizhu{}
	mz.Name="test"
	mz.Brand="wei"
	mz.price=12.3
	mz.Address="sz"

	mz.Show()
	fmt.Println(mz)

	mz1:=meizhu{huawai{"sss","bb",122.3},"北京"}

	fmt.Println(mz1)

	rys:=ry{
		huawai{
			Name:"ry",
			Brand:"hua",
			price:111.2,
		},
		110,
		"bbb",
	}

	fmt.Println(rys,rys.int,rys.na)


}